package UVA;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Scanner;

/*
 * @Author Josh Lear
 * @Date 4-15-2014
 * @Problem mechanics, add-hoc
 */
public class UVA_11498 {
    static int ox;
    static int oy;

    public static void main (String[] args) throws IOException {
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
                System.out));
        Scanner sc = new Scanner(System.in);
        while (true) {
            int queries = sc.nextInt();
            if (queries == 0) {
                break;
            }
            ox = sc.nextInt();
            oy = sc.nextInt();
            for (int i = 0; i < queries; i++) {
                int x = sc.nextInt();
                int y = sc.nextInt();
                bw.write(handle(x, y) + "\n");

            }

        }
        bw.flush();
        sc.close();
    }

    public static String handle (int x, int y) {
        String s = "";
        if (x == ox || y == oy) {
            return "divisa";
        }
        if (y > oy) {
            s += "N";
        } else {
            s += "S";
        }
        if (x > ox) {
            s += "E";
        } else {
            s += "O";
        }
        return s;
    }
}
